package io;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import  java.util.Scanner;
public class Test {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("note.txt");
        System.out.println("请输入：");
        while (true){
        String line = scan.nextLine();
        if ("exit".equalsIgnoreCase(line)){//equalsIgnoreCase忽略大小写
            break;
        }
        fos.write(line.getBytes(StandardCharsets.UTF_8));
        }
        fos.close();

    }
}
